package com.yihusitian.zsxq.pojo.dto;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;

import java.util.Date;

/**
 * @Description TODO
 * @Author LeeHo
 * @Date 2021/3/25 16:40
 */
public class DateHandler {

    public static Date parseDate(String dateTime) {
        if (StrUtil.isEmpty(dateTime)) {
            return new Date();
        }
        String time = dateTime.replaceAll(" 0800", "").replaceAll("T", " ");
        return DateUtil.parse(time, DatePattern.NORM_DATETIME_MS_PATTERN);
    }
}